<?php
require_once("../include/bm_config.php");
	
	if (!isset($_SESSION['administrator']) && !isset($_SESSION[$BM_ADMIN]))
	{
			echo "<script language='javascript'>\n";
			echo "alert('没有权限!');\n";
			echo " location.replace('".$BM_HOME."') ;\n";
			echo "</script>";
			mysql_free_result($result);
			exit(0);
	}
	if($_GET['usernum'])
	{
		$user_num = intval($_GET['usernum']);
		$sql="SELECT `user_num`, `user_name` FROM `cr_user` WHERE `user_num`=$user_num ";
		$result=mysql_query($sql);
		$rows_cnt=mysql_num_rows($result);
		if($rows_cnt == 0)
		{
				echo "<script language='javascript'>\n";
				echo "alert('没有这样一个用户!');\n";
				echo "history.go(-1);\n";
				echo "</script>";
				mysql_free_result($result);
				exit(0);
		}
		$row=mysql_fetch_object($result);
		mysql_free_result($result);
		$sql="DELETE FROM `cr_user` WHERE `user_num`=$user_num";
		mysql_query($sql);// or die(mysql_error());
		echo "<script language='javascript'>\n";
		echo "alert('".$row->user_num.":".$row->user_name." 删除成功!');\n";
		echo "history.go(-1);\n";
		echo "</script>";
	}
	else
	{
			echo "<script language='javascript'>\n";
			echo "alert('这儿什么都没有~~');\n";
			echo " location.replace('".$BM_HOME."') ;\n";
			echo "</script>";
			mysql_free_result($result);
			exit(0);
	}
		
?>